<?php

namespace common\domain\helper;

use Yii;
use yii\helpers\ArrayHelper;

class Request
{
    public static function getRequest($name = null)
    {
        $request = Yii::$app->request;

        $data = ArrayHelper::merge($request->getBodyParams(), $request->getQueryParams());

        return null !== $name ? addslashes($data[$name]) : $data;
    }
}
